!function() {
    var t = require("../../05BFE3A3C6098CCF63D98BA434E9C3F4.js")(require("../../9D53CC23C6098CCFFB35A4246909C3F4.js")), a = getApp();
    let o = null;
    Page({
        data: {
            wechat: "",
            spaceShow: !0,
            modalName: !1,
            picName: "流星之夜",
            pic: [ {
                link: "https://file-1258040671.cos.ap-nanjing.myqcloud.com/avatar/bg/zjx_me_bg1.jpeg",
                name: "春天"
            }, {
                link: "https://file-1258040671.cos.ap-nanjing.myqcloud.com/avatar/bg/zjx_me_bg2.jpeg",
                name: "夏天"
            }, {
                link: "https://file-1258040671.cos.ap-nanjing.myqcloud.com/avatar/bg/zjx_me_bg3.jpeg",
                name: "秋天"
            }, {
                link: "https://file-1258040671.cos.ap-nanjing.myqcloud.com/avatar/bg/zjx_me_bg4.jpeg",
                name: "冬天"
            }, {
                link: "https://file-1258040671.cos.ap-nanjing.myqcloud.com/avatar/bg/zjx_me_bg5.jpeg",
                name: "幽静"
            }, {
                link: "https://file-1258040671.cos.ap-nanjing.myqcloud.com/avatar/bg/zjx_me_bg6.jpg",
                name: "天空"
            } ],
            topBackGroupImageIndex: 5,
            inter: [ {
                title: "mimicry",
                name: "活力春天",
                color: "green"
            }, {
                title: "theme",
                name: "清爽夏日",
                color: "blue"
            }, {
                title: "theme",
                name: "金秋之韵",
                color: "orange"
            }, {
                title: "theme",
                name: "冬日之阳",
                color: "pink"
            }, {
                title: "theme",
                name: "幽兰星空",
                color: "red"
            }, {
                title: "theme",
                name: "流星之夜",
                color: "purple"
            } ],
            mengShow: !1,
            imgDraw: [],
            poster_path: "",
            poster_show: !1,
            qr_url: "https://www.daijingjuan.com/attachment/images/A.jpg",
            img_url: "https://file-1258040671.cos.ap-nanjing.myqcloud.com/touxiang/beijing/header1.jpg",
            head_url: "https://bcn.135editor.com/files/users/623/6230178/202204/wD5VwqSm_hRZO.jpg",
            CustomBar: "",
            detail: []
        },
        onLoad: function(t) {
            this.setData({
                CustomBar: a.globalData.CustomBar
            }), this.getIndex(), wx.createInterstitialAd && (o = wx.createInterstitialAd({
                adUnitId: "adunit-b9abf64b40dddf8d"
            }), o.onLoad(() => {}), o.onError(t => {}), o.onClose(() => {}));
        },
        _getPoster: function() {
            console.log(e.detail.path), console.log(e.detail.query);
        },
        getIndex: function() {
            var e = this;
            t.default.postRequest("/api/Image/home", {}, "", "", function(t) {
                e.setData({
                    detail: t.data.data
                });
            }, function(t) {
                wx.showToast({
                    title: "请求失败",
                    icon: "none",
                    duration: 3e3
                });
            });
        },
        zhuti: function(t) {
            this.setData({
                modalName: !0
            });
        },
        mengban: function(t) {
            this.setData({
                modalName: !1
            });
        },
        sel: function(t) {
            var e = t.currentTarget.dataset.index;
            this.setData({
                topBackGroupImageIndex: e,
                modalName: !1,
                picName: this.data.inter[e].name
            });
        },
        onReady: function() {},
        onShow: function() {
            o && o.show().catch(t => {
                console.error(t);
            });
        },
        onHide: function() {},
        onUnload: function() {},
        onPullDownRefresh: function() {},
        onReachBottom: function() {},
        onShareAppMessage: function() {
            return {
                title: "头像制作神器，支持1000+种小挂件",
                imageUrl: "https://www.daijingjuan.com/attachment/images/2.png",
                path: "/pages/home/home",
                success: function(t) {
                    console.log(t);
                }
            };
        },
        _onImgOK: function(t) {
            wx.hideLoading({});
            var e = t.detail.path;
            this.data.poster_path = e, this.setData({
                poster_path: e,
                poster_show: !0,
                mengShow: !1
            }), wx.showToast({
                title: "点击图片，长按分享",
                icon: "none",
                duration: 3e3
            });
        },
        _closeModal: function(t) {
            this.setData({
                poster_show: !1
            });
        },
        _saveAlbum: function(t) {
            this.data.poster_path && wx.saveImageToPhotosAlbum({
                filePath: this.data.poster_path,
                success: function(t) {
                    wx.showToast({
                        title: "保存成功!",
                        icon: "success",
                        duration: 1e3
                    });
                },
                fail: function(t) {
                    wx.showModal({
                        title: "提示",
                        content: "请先授权，再保存海报图片",
                        showCancel: !1,
                        success: function(t) {
                            t.confirm && wx.openSetting({
                                success: function(t) {
                                    t.authSetting["scope.writePhotosAlbum"] ? wx.saveImageToPhotosAlbum({
                                        filePath: e.data.poster_path,
                                        success: function(t) {
                                            wx.showToast({
                                                title: "保存成功!",
                                                icon: "success",
                                                duration: 1e3
                                            });
                                        }
                                    }) : wx.showModal({
                                        title: "温馨提示",
                                        content: "授权失败，请稍后重新获取!",
                                        showCancel: !1
                                    });
                                }
                            });
                        }
                    });
                }
            });
        },
        _previewPoster: function() {
            wx.previewImage({
                urls: [ this.data.poster_path ],
                current: this.data.poster_path
            });
        }
    });
}();